//
//  DWESexView.m
//  YWLJMapView
//
//  Created by DWE_KJ on 2017/1/3.
//  Copyright © 2017年 Mr-yuwei. All rights reserved.
//

#import "DWESexView.h"

@interface DWESexView()
@property (nonatomic, strong) UIImageView *imageView;

@end

@implementation DWESexView

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.imageView];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.imageView];
    }
    return self;
}

- (void)showSex:(BOOL)sex
{
    if (sex)
    {
        self.imageView.image = [UIImage imageNamed:@"map_icon_male"];
    }
    else
    {
        self.imageView.image = [UIImage imageNamed:@"map_icon_female"];
    }
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat width = CGRectGetWidth(self.frame);
    CGFloat height = CGRectGetHeight(self.frame);
    self.imageView.center = CGPointMake(width/2, height/2);
    self.imageView.frame = CGRectMake(0, 0, 50, 50);
}

- (UIImageView *)imageView
{
    if (!_imageView)
    {
        _imageView = [UIImageView new];
        
    }
    return _imageView;
}

@end
